import {Component, OnInit} from '@angular/core';
import {BladeService} from '../../../shared/blade.service';
import {Blade} from '../../../shared/blade/blade.model';
import {BladeData} from '../../../shared/blade/blade-data';
import {ToolbarService} from '../../../shared/toolbar.service';
import {DialogService} from '../../../shared/dialog.service';
import {Observable} from 'rxjs/Observable';
import {BladeContainerInterface} from '../../../shared/blade/blade-container.interface';
import {TagListComponent} from './tag-list/tag-list.component';
//import { TagService } from "../../../service/tag.service";
import {Tag} from '../../../entity/tag.model';

@Component({
  selector: 'app-tag',
  templateUrl: './tag.component.html',
  styleUrls: ['./tag.component.css'],
  providers: [BladeService]
})
export class TagComponent implements OnInit {
  /**
   * 当前弹出层
   *
   * @type {Blade}
   * @memberof BladeContainerInterface
   */
  currentBlade: Blade;

  constructor(public bladeService: BladeService,) {
  }

  ngOnInit() {
    this.createTurbastatusListBlade()
  }

  /**
   * 创建测点信息列表弹出层
   *
   *
   * @memberof TagComponent
   */
  createTurbastatusListBlade() {
    let data: BladeData = new BladeData();
    data.id = 'TurbastatusList';
    data.title = '测点信息';
    data.subtitle = '测点信息';
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(TagListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }

  /**
   * 是否可以离开
   *
   *
   * @memberof TagComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/tag/tag.component.ts
